package model

type StockApiResource struct {
	Id               int32      `gorm:"column:id;primary_key;AUTO_INCREMENT;NOT NULL" json:"id,omitempty"`
	ApiName          string     `gorm:"column:api_name;NOT NULL;comment:'接口名'" json:"apiName,omitempty"`
	ApiPath          string     `gorm:"column:api_path;NOT NULL;comment:'接口地址'" json:"apiPath,omitempty"`
	BasePath         string     `gorm:"-" json:"basePath,omitempty"` //基础接口地址 - 忽略字段 非DB中数据
	ApiType          string     `gorm:"column:api_type;NOT NULL;comment:'请求方式 GET/POST/PUT/'" json:"apiType,omitempty"`
	ApiFunction      string     `gorm:"column:api_function;NOT NULL;comment:'接口功能'" json:"apiFunction,omitempty"`
	AccessMethod     string     `gorm:"column:access_method;default:NULL;comment:'api访问方法'" json:"accessMethod,omitempty"`
	Status           string     `gorm:"column:status;default:Y;comment:'状态 Y/N 正常/禁用'" json:"status,omitempty"`
	Remark           string     `gorm:"column:remark;default:null;comment:'备注说明'" json:"remark,omitempty"`
	CreateTime       *LocalTime `gorm:"column:create_time;default:CURRENT_TIMESTAMP;NOT NULL" json:"createTime"`
	LastUpdTime      *LocalTime `gorm:"column:last_upd_time;default:CURRENT_TIMESTAMP;NOT NULL" json:"lastUpdTime"`
	ResourceLeveMark string     `gorm:"column:resource_leve_mark;NOT NULL" json:"resourceLeveMark,omitempty"`
}

func NewStockApiResourceModel() *StockApiResource {
	return &StockApiResource{}
}

func (s *StockApiResource) TableName() string {
	return "stock_api_resource"
}
